/**
 * @file        projects.ipp
 * @brief       Defines methods related with projects.
 *
 * @author      Emre Turkay <emreturkay at gmail>
 * @date        May.30.2008 (as projects.cpp)
 *
 * Copyright Emre Turkay 2009
 * Distributed under the Boost Software License, Version 1.0.
 * (See accompanying file COPYRIGHT or copy at
 * http://www.boost.org/LICENSE_1_0.txt)
 */

namespace gtd
{

inline project::project()
{
}

inline project::project(const std::string& name)
    : name_(name)
{
}

inline const boost::optional<std::string>& project::name() const
{
    return name_;
}

inline void project::prepend(const action& item)
{
    actions_.push_front(item);
}

inline void project::append(const action& item)
{
    actions_.push_back(item);
}

inline project::action_id project::top() const
{
    return actions_.front_id();
}

inline void project::erase(project::action_id index)
{
    actions_.erase(index);
}

inline bool project::empty() const
{
    return actions_.empty();
}

inline size_t project::item_count() const
{
    return actions_.size();
}

inline std::list<project::action_id> project::items() const
{
    return actions_.ids();
}

inline const action& project::item(action_id index) const
{
    return actions_[index];
}

} // namespace gtd
